<template>
  <formPage ref="formPageRef" :formList="formData" validCatch="联系人信息有未填写的数据！" identifying="tab2" />
</template>
<script setup>
const props = defineProps({
  formList: {
    type: Array,
    default: [],
  },
});
let formPageRef = ref(null);
const formData = computed(() => {
  return props.formList
    .filter((item) => {
      return item.in_form == 1;
    })
    .map((ele) => {
      let obj = {
        label: ele.name,
        prop: ele.field,
        formType: ele.form_type,
        required: ele.is_null == 1 ? true : false,
        rulesMessage: ele.input_tips || ele.name,
        placeholder: ele.input_tips || ele.name,
        termList: ele.termList,
      };

      return obj;
    });
});

onMounted(() => { });
function initFun() {
  formPageRef.value.initFun();
}
defineExpose({
  initFun,
});
</script>
<style scoped lang="scss">
.ruleform-tab {
  :deep(.el-form-item) {
    width: 100%;
    margin-right: 0;
    padding-right: 10px;
    box-sizing: border-box;

    .el-input {
      width: 100%;
    }
  }
}
</style>
